﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admins/Administrator.Master" AutoEventWireup="true" CodeBehind="User.aspx.cs" Inherits="MyWeb.Admins.User" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="title">Quản trị người dùng</div>
    <asp:Panel ID="pnShow" Width="100%" runat="server">
        <table id="table1" style="border-collapse:collapse; background-color: #DODEFD;">
            <tr>
                <td>
                    <asp:Button ID="btnThem" runat="server" CssClass="btnthem" Text="Thêm mới" 
                        onclick="btnThem_Click" />
                </td>
            </tr>
        </table>
        <asp:DataGrid ID="grdUser" runat="server" AllowPaging="true" 
            AutoGenerateColumns="false" CellPadding="4" ForeColor="#33333" Width="100%" 
            PageSize="10" onitemcommand="grdUser_ItemCommand" 
            onpageindexchanged="grdUser_PageIndexChanged">
            <AlternatingItemStyle BackColor="White" />
            <HeaderStyle CssClass="trHeader" />
            <Columns>
                <asp:BoundColumn DataField="Username" HeaderText="Tài khoản"></asp:BoundColumn>
                <asp:BoundColumn DataField="Name" HeaderText="Tên người dùng"></asp:BoundColumn>
                <asp:BoundColumn DataField="Rule" HeaderText="Quyền"></asp:BoundColumn>
                <asp:BoundColumn DataField="Status" HeaderText="Trạng thái"></asp:BoundColumn>
                <asp:TemplateColumn>
                    <HeaderTemplate>Chức năng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="lbt1" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id") %>' CommandName="Edit" CssClass="edit" ToolTip="Sửa" /> |
                        <asp:LinkButton runat="server" ID="lbt2" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id") %>' CommandName="Delete" CssClass="delete" ToolTip="Xóa" OnClientClick="return confirm(Bạn có chắc muốn xóa không?)" />
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <EditItemStyle BackColor="#2461BF" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="true" ForeColor="White" />
            <ItemStyle BackColor="#EFF3FB" />
            <PagerStyle BackColor="#F3F8FE" ForeColor="Blue" HorizontalAlign="Center" Mode="NumericPages" />
            <SelectedItemStyle BackColor="#D1DDF1" Font-Bold="true" ForeColor="#33333" />
        </asp:DataGrid>
    </asp:Panel>
    <asp:Panel ID="pnUpdate" runat="server" Visible="False">
        <table id="table2" style="border-collapse:collapse;" cellpadding="0" width="100%" border="0">
            <tr>
                <td width="150" class="name_fild_row">
                    <asp:Label Text="Tên đăng nhập" runat="server" />
                </td>
                <td>
                    <asp:TextBox ID="txtUsername" runat="server" />
                    <asp:TextBox ID="txtId" runat="server" Visible="false" />
                </td>
            </tr>
            <tr>
                <td width="150" class="name_fild_row">
                    <asp:Label Text="Mật khẩu" runat="server" />
                </td>
                <td>
                    <asp:TextBox ID="txtPassword" runat="server" />
                </td>
            </tr>
            <tr>
                <td width="150" class="name_fild_row">
                    <asp:Label Text="Tên người dùng" runat="server" />
                </td>
                <td>
                    <asp:TextBox ID="txtName" runat="server" />
                </td>
            </tr>
            <tr>
                <td width="150" class="name_fild_row">
                    <asp:Label Text="Quyền hạn" runat="server" />
                </td>
                <td>
                    <asp:DropDownList ID="ddlRule" runat="server">
                        <asp:ListItem Value="1">Admin</asp:ListItem>
                        <asp:ListItem Value="2">User</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td width="150" class="name_fild_row">
                    <asp:Label ID="Label1" Text="Quyền hạn" runat="server" />
                </td>
                <td>
                    <asp:DropDownList ID="ddlStatus" runat="server">
                        <asp:ListItem Value="1">Sử dụng</asp:ListItem>
                        <asp:ListItem Value="0">Cấm sử dụng</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td width="150" class="name_fild_row"></td>
                <td>
                    <asp:LinkButton ID="lbtUpdate" CssClass="update" runat="server" 
                        onclick="lbtUpdate_Click">Cập nhật</asp:LinkButton>
                    <asp:LinkButton ID="lbtBack" CssClass="back" runat="server" 
                        onclick="lbtBack_Click">Trở lại</asp:LinkButton>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
